<?php

use yii\db\Migration;

class m180604_023212_alter_msg_template extends Migration
{
    /**
     * @inheritdoc
     */
    public function safeUp()
    {
        $this->addColumn('{{%msg_template}}','msg_template_event',$this->string(255)->defaultValue(null)->comment('模板对应事件'));
        $this->addColumn('{{%msg_template}}','receive_group',$this->string(15)->defaultValue(null)->comment('接收组'));
    }

    public function safeDown()
    {
        $this->dropColumn('{{%msg_template}}', 'msg_template_event');
        $this->dropColumn('{{%msg_template}}', 'receive_group');
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m180604_023212_alter_msg_template cannot be reverted.\n";

        return false;
    }
    */
}
